package com.acarter.scenemonitor.propertydescriptor.enums;
/**
 * <p>Title</p>
 * 
 * <p>Description: </p>
 *
 * <p>Copyright (c) 2007</p>
 *
 * @author Andrew Carter
 * @version 
 */


/**
 * Enumerates the permissible resource types.
 * 
 * @author Andrew Carter
 */
public enum E_ResourceType {
	

	TYPE_AUDIO("audio", "Audio"),
	TYPE_MODEL("model", "Model"),
	TYPE_PARTICLE("particle", "Particle"),
	TYPE_SHADER("shader", "Shader"),
	TYPE_TEXTURE("texture", "Texture");

	/** Integer value of the enum value */
	private String type;

	/** String representation of the enum value */
	private String displayName;

	/**
	 * Private constructor.
	 * 
	 * @param value
	 *            String literal of the enum
	 */
	private E_ResourceType(String type, String displayName) {

		this.type = type;
		this.displayName = displayName;
	}

	/**
	 * Returns the enum constant matching the name string.
	 * 
	 * @param name
	 *            string value of enum constant
	 * @return matching enum constant or null
	 */
	public static E_ResourceType getConstant(String displayName) {

		for (E_ResourceType constant : E_ResourceType.values()) {

			if (constant.displayName.compareToIgnoreCase(displayName) == 0)
				return constant;
		}

		return null;
	}

	/**
	 * Returns the string value of the constant.
	 */
	public String toString() {

		return displayName;
	}
	
	/**
	 * Returns the integer value of the constant.
	 * @return 
	 */
	public String getType() {
		
		return type;
	}
}
